package com.cxs.custombuttondemo.slice;

import com.cxs.app.uilib.bar.IMTitleBar;
import com.cxs.custombuttondemo.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;

public class MainAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);
        IMTitleBar titleBar = (IMTitleBar)findComponentById(ResourceTable.Id_imtitlebar);
        titleBar.setBackClickedListener(c -> {
            System.out.println("点击了返回");
        });
        titleBar.setSearchClickedListener(c -> {
            System.out.println("点击了搜索");
        });
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
